define([], function(){
    var tpl = {};
    tpl.init = function (){
        var html = '';
        html += amis();
        return html;
    };
    tpl.init2 = function (){
        var html = '';
        html += history();
        return html;
    };
    tpl.init3 = function (){
        var html = '';
        html += infoDetail();
        return html;
    };
    var amis = function(){
        return '<script type="text/html" id="amis-tpl">'+
                '{{each data as value}}'+
                '<div {{if value.flag}} class="box select" {{else}} class="box" {{/if}} score = "{{value.score}}" id="{{type}}{{value.id}}">'+
                    '<div class="ques-title">{{value.name}}</div>'+
                    '<div class="picture"><img src="{{value.picture}}"></div>'+
                    '<div>{{value.desc}}</div>'+
                    '<div class="symbol">'+
                        '<i {{if value.flag}} class="fa fa-check-circle" {{else}} class="fa fa-minus-circle" {{/if}}  aria-hidden="true"></i>'+
                    '</div>'+
                '</div>'+
                '{{/each}}'+
                '</script>'
    };
    var history = function(){
        return '<script type="text/html" id="history-tpl">'+
            '{{each data as value}}'+
            '<li answerId = "{{value.answerId}}"><span class="right"></span>{{value.testTime}}({{value.testAge}})</li>'+
            '{{/each}}'+
            '</script>'
    };
    var infoDetail = function(){
        return '<script type="text/html" id="infoDetail-tpl">'+
                    '<div class="user-info">'+
                        '<ul class="clear">'+
                            '<li><div>姓名</div><span>{{userName}}</span></li>'+
                            '<li><div>性别</div><span>{{gender}}</span></li>'+
                            '<li><div>实际年龄</div><span>{{actualAge}}</span></li>'+
                            '<li><div>纠正年龄</div><span>{{age}}</span></li>'+
                            '<li><div>评估时间</div><span>{{testTime}}</span></li>'+
                        '</ul>'+
                    '</div>'+
                '<div class="user-result">'+
                    '<ul class="clear">'+
                        '<li><div class="{{className}}"><div>总分</div><font class="{{className}}">{{totalScore}}</font><div>{{percent}}</div></div></li>'+
                       ' <li>'+
                            '<div class="result-circle"><div>俯卧位</div><font>{{preWindowProne + windowProne}}</font></div>'+
                            '<div class="result-val"><div><font>{{preWindowProne}}</font><div class="result-pro">窗前项目</div></div><div><font>{{windowProne}}</font><div class="result-pro">窗内项目</div></div></div>'+
                        '</li>'+
                        ' <li>'+
                            '<div class="result-circle"><div>仰卧位</div><font>{{preWindowDorsa + windowDorsa}}</font></div>'+
                            '<div class="result-val"><div><font>{{preWindowDorsa}}</font><div class="result-pro">窗前项目</div></div><div><font>{{windowDorsa}}</font><div class="result-pro">窗内项目</div></div></div>'+
                        '</li>'+
                        ' <li>'+
                            '<div class="result-circle"><div>坐位</div><font>{{preWindowSeats + windowSeats}}</font></div>'+
                            '<div class="result-val"><div><font>{{preWindowSeats}}</font><div class="result-pro">窗前项目</div></div><div><font>{{windowSeats}}</font><div class="result-pro">窗内项目</div></div></div>'+
                        '</li>'+
                        ' <li>'+
                            '<div class="result-circle"><div>站立位</div><font>{{preWindowStand + windowStand}}</font></div>'+
                            '<div class="result-val"><div><font>{{preWindowStand}}</font><div class="result-pro">窗前项目</div></div><div><font>{{windowStand}}</font><div class="result-pro">窗内项目</div></div></div>'+
                        '</li>'+
                    '</ul>'+
                '</div>'+
           '</script>'
    }
    return tpl;
});